package com.youtills.resource;

/**
 * TODO - !!!doc me!!!
 *
 * @author ravi.chiluveru
 * @since 23.0 (10/16/14)
 */
class RelationshipImpl<L extends Resource, R extends Resource> implements Relationship<L, R> {

    private final Long relationshipId;
    private final String relationshipName;
    private final Class<L> leftClass;
    private final Class<R> rightClass;
    private final Integer leftMinCount;
    private final Integer leftMaxCount;
    private final Integer rightMinCount;
    private final Integer rightMaxCount;
    private final Boolean allowDuplicate;

    RelationshipImpl(Long relationshipId, String relationshipName, Class<L> leftClass, Class<R> rightClass, Integer leftMinCount, Integer leftMaxCount, Integer rightMinCount, Integer rightMaxCount, Boolean allowDuplicate) {
        this.relationshipId = relationshipId;
        this.relationshipName = relationshipName;
        this.leftClass = leftClass;
        this.rightClass = rightClass;
        this.leftMinCount = leftMinCount;
        this.leftMaxCount = leftMaxCount;
        this.rightMinCount = rightMinCount;
        this.rightMaxCount = rightMaxCount;
        this.allowDuplicate = allowDuplicate;
    }

    public Long getRelationshipId() {
        return relationshipId;
    }

    public String getRelationshipName() {
        return relationshipName;
    }

    public Class<L> getLeftClass() {
        return leftClass;
    }

    public Class<R> getRightClass() {
        return rightClass;
    }

    public Integer getLeftMinCount() {
        return leftMinCount;
    }

    public Integer getLeftMaxCount() {
        return leftMaxCount;
    }

    public Integer getRightMinCount() {
        return rightMinCount;
    }

    public Integer getRightMaxCount() {
        return rightMaxCount;
    }

    public Boolean getAllowDuplicate() {
        return allowDuplicate;
    }
}